<?php
class Dig_View_Helper_DigItemTemplate extends Zend_View_Helper_Abstract 
{
    public function digItemTemplate(DigCms_Model_Item $item, $template)
    {
        return $this->_loadTemplate($item, $template);
    }
    
    protected function _loadTemplate($item, $template)
    {
        foreach ($item->toArray() as $property => $value) {
            $template = str_replace('{' . $property . '}', $value, $template);
        }
        return $template;
    }
}
?>